naming cleanup
authorØyvind Kolås <ok@src.gnome.org>
Sun, 21 Aug 2005 16:39:56 +0000 (16:39 +0000)
committerØyvind Kolås <ok@src.gnome.org>
Sun, 21 Aug 2005 16:39:56 +0000 (16:39 +0000)
16 files changed:
ChangeLog
babl/babl-classes.h
babl/babl-fish.c
babl/babl-ids.h
babl/base/babl-base.c
babl/base/model-gray.c
babl/base/model-grayscale.c
babl/base/model-lab.c
babl/base/model-rgb.c
babl/base/model-ycbcr.c
tests/float_to_u8.c
tests/grayscale_to_rgb.c
tests/rgb_to_lab_to_rgb.c
tests/rgb_to_ycbcr.c
tests/rgb_to_ycbcr_to_rgb.c
tests/u8_to_float.c

index fccf39ac2bf8780072b938b724ac5829dea6bc96..70af25006f8e8cb294e2743d95eaec5bff530d5b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2005-08-21  Øyvind Kolås  <pippin@gimp.org>
+
+       * babl/babl-classes.h: reindent, some documentation.
+       * babl/babl-fish.c: (babl_fish_reference_new): assertions for
+       arguments.
+       * babl/babl-ids.h: cleanup.
+       * babl/base/babl-base.c: (models): grayscale->gray
+       * babl/base/model-grayscale.c: (babl_base_model_gray),
+       (components), (models), (rgb_to_gray), (rgb_to_gray_2_2),
+       (gray_2_2_to_rgb), (gray_to_rgb),
+       (gray_alpha_premultiplied_to_rgba),
+       (rgba_to_gray_alpha_premultiplied), (conversions): grayscale->gray,
+       added gamma-2.2 with alpha.
+       * babl/base/model-lab.c: 
+       * babl/base/model-rgb.c: 
+       * babl/base/model-ycbcr.c: Name normalizations
+       * tests/float_to_u8.c: (test_float_to_rgb_u8):
+       * tests/grayscale_to_rgb.c: (test):
+       * tests/rgb_to_lab_to_rgb.c: (test):
+       * tests/rgb_to_ycbcr.c: (test):
+       * tests/rgb_to_ycbcr_to_rgb.c: (test):
+       * tests/u8_to_float.c: (test): Name synchronization.
+
 2005-08-18  Øyvind Kolås  <pippin@gimp.org>
 
        * babl/base/util.h: added new and hopefully correct gamma correction
index a11f2aef19fc3532923951ba9280b665079e7ca6..2ac7b94ec185c22e937cc1fa1c2f21f162a5c9ee 100644 (file)
@@ -87,7 +87,7 @@ typedef struct
 } BablInstance;
 
 typedef struct
-{
+BablConversion {
   BablInstance           instance;
   union Babl            *source;
   union Babl            *destination;
@@ -101,9 +101,10 @@ typedef struct
     } function;
 } BablConversion;
 
-typedef struct
-{
-  BablConversion conversion;
+typedef struct {
+  BablConversion       conversion;
+  BablConversion      *from_double;
+  BablConversion      *to_double;
 } BablConversionType;
 
 typedef struct
@@ -195,9 +196,25 @@ typedef struct
   union Babl      *destination;
 } BablFish;
 
+
+/* a BablFish which is a reference babl fish relies on the double
+ * versions that are required to exist for maximum sanity.
+ *
+ * A BablFishReference is not intended to be fast, thus the algorithm
+ * encoded can use a multi stage approach, where some of the stages could
+ * be completely removed for optimization reasons.
+ *
+ * This is not the intention of the "BablFishReference factory", it's
+ * implementation is meant to be kept as small as possible wrt logic.
+ *
+ * One of the contributions that would be welcome are new fish factories.
+ */
+
+
 typedef struct
 {
   BablFish         fish;
+
   BablConversion  *type_to_double;
   BablConversion  *model_to_rgba;
   BablConversion  *rgba_to_model;
index 403bb91666dfd93ef6ecf72338e98141250f1d7f..fdb06a208a8bc71c636ba0a26119814820c2806c 100644 (file)
@@ -124,36 +124,67 @@ babl_fish_reference_new (Babl *source,
   assert (BABL_IS_BABL (source));
   assert (BABL_IS_BABL (destination));
 
+  assert (source->class_type == BABL_PIXEL_FORMAT ||
+          source->class_type == BABL_MODEL);
+  assert (destination->class_type == BABL_PIXEL_FORMAT ||
+          destination->class_type == BABL_MODEL);
+
   babl                   = babl_calloc (sizeof (BablFishReference), 1);
   babl->class_type       = BABL_FISH_REFERENCE;
   babl->instance.id      = 0;
   babl->instance.name    = NULL;
   babl->fish.source      = (union Babl*)source;
   babl->fish.destination = (union Babl*)destination;
-
-  babl->reference_fish.type_to_double =
-     babl_conversion_find (
-        source->pixel_format.type[0],
-        babl_type_id (BABL_DOUBLE)
-     );
-
-  babl->reference_fish.model_to_rgba =
-    babl_conversion_find (
-        source->pixel_format.model[0],
-        babl_model_id (BABL_RGBA)
-    );
-
-  babl->reference_fish.rgba_to_model =
-    babl_conversion_find (
-        babl_model_id (BABL_RGBA),
-        destination->pixel_format.model[0]
-    );
-
-  babl->reference_fish.double_to_type =
-    babl_conversion_find (
-        babl_type_id (BABL_DOUBLE),
-        destination->pixel_format.type[0]
-    );
+  if (source->class_type == BABL_PIXEL_FORMAT)
+    {
+      babl->reference_fish.type_to_double =
+         babl_conversion_find (
+            source->pixel_format.type[0],
+            babl_type_id (BABL_DOUBLE)
+         );
+
+      babl->reference_fish.model_to_rgba =
+        babl_conversion_find (
+            source->pixel_format.model[0],
+            babl_model_id (BABL_RGBA)
+        );
+
+      babl->reference_fish.rgba_to_model =
+        babl_conversion_find (
+            babl_model_id (BABL_RGBA),
+            destination->pixel_format.model[0]
+        );
+
+      babl->reference_fish.double_to_type =
+        babl_conversion_find (
+            babl_type_id (BABL_DOUBLE),
+            destination->pixel_format.type[0]
+        );
+    }
+  else if (source->class_type == BABL_MODEL)
+    { 
+      babl->reference_fish.type_to_double = NULL;
+
+
+      babl->reference_fish.model_to_rgba =
+        babl_conversion_find (
+            source->pixel_format.model[0],
+            babl_model_id (BABL_RGBA)
+        );
+
+      babl->reference_fish.rgba_to_model =
+        babl_conversion_find (
+            babl_model_id (BABL_RGBA),
+            destination->pixel_format.model[0]
+        );
+
+      babl->reference_fish.double_to_type =
+        babl_conversion_find (
+            babl_type_id (BABL_DOUBLE),
+            destination->pixel_format.type[0]
+        );
+    }
 
   if (db_insert (babl) == babl)
     {
index 9f6f3314368932f0cd35277dcd0743d2f9e74fba..4a882eb5f2c82473869f600798e60c8f76d06de9 100644 (file)
@@ -34,47 +34,48 @@ enum {
   BABL_GREEN,
   BABL_BLUE,
   BABL_ALPHA,
-  BABL_LUMINANCE,
-  BABL_LUMINANCE_GAMMA_2_2,
-  BABL_LUMINANCE_MUL_ALPHA,
   BABL_RED_MUL_ALPHA,
   BABL_GREEN_MUL_ALPHA,
   BABL_BLUE_MUL_ALPHA,
   BABL_RED_GAMMA_2_2,
   BABL_GREEN_GAMMA_2_2,
   BABL_BLUE_GAMMA_2_2,
+  BABL_LUMINANCE,
+  BABL_LUMINANCE_GAMMA_2_2,
+  BABL_LUMINANCE_MUL_ALPHA,
+  BABL_X,
+  BABL_Y,
+  BABL_Z,
+  BABL_LAB_L,
+  BABL_LAB_A,
+  BABL_LAB_B,
+  BABL_CB,
+  BABL_CR,
   BABL_CYAN,
   BABL_MAGENTA,
   BABL_YELLOW,
   BABL_KEY,
-  BABL_CB,
-  BABL_CR,
-  BABL_LAB_L,
-  BABL_LAB_A,
-  BABL_LAB_B,
-  BABL_X,
-  BABL_Y,
-  BABL_Z,
   BABL_Z_BUFFER,
   BABL_PADDING,
 
   BABL_MODEL_BASE = 10000,
   BABL_RGB,
-  BABL_RGB_GAMMA_2_2,
   BABL_RGBA,
+  BABL_RGB_GAMMA_2_2,
   BABL_RGBA_GAMMA_2_2,
   BABL_RGBA_PREMULTIPLIED,
-  BABL_GRAYSCALE,
-  BABL_GRAYSCALE_GAMMA_2_2,
-  BABL_GRAYSCALE_ALPHA,
-  BABL_GRAYSCALE_ALPHA_PREMULTIPLIED,
+  BABL_GRAY,
+  BABL_GRAY_ALPHA,
+  BABL_GRAY_GAMMA_2_2,
+  BABL_GRAY_GAMMA_2_2_ALPHA,
+  BABL_GRAY_ALPHA_PREMULTIPLIED,
   BABL_YCBCR,
-  BABL_YCBCRA,
+  BABL_YCBCR_ALPHA,
   BABL_LAB,
   BABL_LAB_ALPHA,
   BABL_CMY,
   BABL_CMYK,
-  BABL_CMYKA,
+  BABL_CMYK_ALPHA,
 
   BABL_PIXEL_FORMAT_BASE = 100000,
   BABL_SRGB,
@@ -82,17 +83,15 @@ enum {
   BABL_RGB_FLOAT,
   BABL_RGBA_FLOAT,
   BABL_RGBA_DOUBLE,
-  BABL_CMYK_FLOAT,
-  BABL_CMYKA_FLOAT,
+  BABL_LAB_FLOAT,
   BABL_YUV420,
-#if 0
   BABL_RGB_U8,
   BABL_RGBA_U8,
   BABL_RGBA_U16,
-  BABL_RGBA_FLOAT,
+  BABL_CMYK_FLOAT,
+  BABL_CMYK_ALPHA_FLOAT,
   BABL_YUV411,
   BABL_YUV422,
-#endif
 
   BABL_PIXEL_USER_BASE,
 };
index 68050cd302ef9ce6b43f1d3a5d4b1eb3300cc4ad..010bbb130206776c22efa5064ef9193c2941b5e5 100644 (file)
@@ -62,18 +62,18 @@ types (void)
  * models
  */
 
-void babl_base_model_rgb       (void);
-void babl_base_model_grayscale (void);
-void babl_base_model_ycbcr     (void);
-void babl_base_model_lab       (void);
+void babl_base_model_rgb   (void);
+void babl_base_model_gray  (void);
+void babl_base_model_ycbcr (void);
+void babl_base_model_lab   (void);
 
 static void
 models (void)
 {
-  babl_base_model_rgb       (); /* must be registered first since it is the
-                                   reference */
-  babl_base_model_grayscale ();
-  babl_base_model_lab       ();
-  babl_base_model_ycbcr     ();
+  babl_base_model_rgb   (); /* must be registered first since it is the
+                               reference, (and contains the alpha definition) */
+  babl_base_model_gray  ();
+  babl_base_model_lab   ();
+  babl_base_model_ycbcr ();
 }
 
index 821a75e78cc4c734bcbe06feb27246cb5aae55e1..5c1dd35c45ee42d6dd2e33472d3695d40717213a 100644 (file)
@@ -17,6 +17,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
+/* FIXME: this file should be renamed model-gray.c */
+
 #include "babl.h"
 #include "util.h"
 #include "rgb-constants.h"
@@ -26,7 +28,7 @@ static void components  (void);
 static void models      (void);
 static void conversions (void);
 
-void babl_base_model_grayscale (void)
+void babl_base_model_gray (void)
 {
   components  ();
   models      ();
@@ -37,13 +39,19 @@ static void
 components (void)
 {
   babl_component_new (
-   "luminance", 
+   "Y", 
    "id",    BABL_LUMINANCE,
    "luma",
    NULL);
 
   babl_component_new (
-   "luminance-gamma2.2", 
+   "Y*A",
+   "id",    BABL_LUMINANCE_MUL_ALPHA,
+   "luma",
+   NULL);
+
+  babl_component_new (
+   "Y-g2.2", 
    "id",    BABL_LUMINANCE_GAMMA_2_2,
    "luma",
    NULL);
@@ -53,27 +61,34 @@ static void
 models (void)
 {
   babl_model_new (
-    "grayscale",
-    "id", BABL_GRAYSCALE,
+    "gray",
+    "id", BABL_GRAY,
     babl_component_id (BABL_LUMINANCE),
     NULL);
 
   babl_model_new (
-    "grayscale-gamma2.2",
-    "id", BABL_GRAYSCALE_GAMMA_2_2,
-    babl_component_id (BABL_LUMINANCE),
+    "gray-g2.2",
+    "id", BABL_GRAY_GAMMA_2_2,
+    babl_component_id (BABL_LUMINANCE_GAMMA_2_2),
     NULL);
 
   babl_model_new (
-    "grayscale-alpha",
-    "id", BABL_GRAYSCALE_ALPHA,
+    "graya-g2.2",
+    "id", BABL_GRAY_GAMMA_2_2_ALPHA,
+    babl_component_id (BABL_LUMINANCE_GAMMA_2_2),
+    babl_component_id (BABL_ALPHA),
+    NULL);
+
+  babl_model_new (
+    "graya",
+    "id", BABL_GRAY_ALPHA,
     babl_component_id (BABL_LUMINANCE),
     babl_component_id (BABL_ALPHA),
     NULL);
 
   babl_model_new (
-    "grayscale-alpha-premultiplied",
-    "id", BABL_GRAYSCALE_ALPHA_PREMULTIPLIED,
+    "grayA",
+    "id", BABL_GRAY_ALPHA_PREMULTIPLIED,
     babl_component_id (BABL_LUMINANCE_MUL_ALPHA),
     babl_component_id (BABL_ALPHA),
     NULL);
@@ -82,13 +97,13 @@ models (void)
 
 
 static void
-rgb_to_grayscale (int    src_bands,
-                  void **src,
-                  int   *src_pitch,
-                  int    dst_bands,
-                  void **dst,
-                  int   *dst_pitch,
-                  int    n)
+rgb_to_gray (int    src_bands,
+             void **src,
+             int   *src_pitch,
+             int    dst_bands,
+             void **dst,
+             int   *dst_pitch,
+             int    n)
 {
   BABL_PLANAR_SANITY
   while (n--)
@@ -118,13 +133,13 @@ rgb_to_grayscale (int    src_bands,
 
 
 static void
-rgb_to_grayscale_2_2 (int    src_bands,
-                      void **src,
-                      int   *src_pitch,
-                      int    dst_bands,
-                      void **dst,
-                      int   *dst_pitch,
-                      int    n)
+rgb_to_gray_2_2 (int    src_bands,
+                 void **src,
+                 int   *src_pitch,
+                 int    dst_bands,
+                 void **dst,
+                 int   *dst_pitch,
+                 int    n)
 {
   BABL_PLANAR_SANITY
   while (n--)
@@ -154,13 +169,13 @@ rgb_to_grayscale_2_2 (int    src_bands,
 
 
 static void
-grayscale_2_2_to_rgb (int    src_bands,
-                      void **src,
-                      int   *src_pitch,
-                      int    dst_bands,
-                      void **dst,
-                      int   *dst_pitch,
-                      int    n)
+gray_2_2_to_rgb (int    src_bands,
+                 void **src,
+                 int   *src_pitch,
+                 int    dst_bands,
+                 void **dst,
+                 int   *dst_pitch,
+                 int    n)
 {
   BABL_PLANAR_SANITY
   while (n--)
@@ -192,13 +207,13 @@ grayscale_2_2_to_rgb (int    src_bands,
 
 
 static void
-grayscale_to_rgb (int    src_bands,
-                  void **src,
-                  int   *src_pitch,
-                  int    dst_bands,
-                  void **dst,
-                  int   *dst_pitch,
-                  int    n)
+gray_to_rgb (int    src_bands,
+             void **src,
+             int   *src_pitch,
+             int    dst_bands,
+             void **dst,
+             int   *dst_pitch,
+             int    n)
 {
   BABL_PLANAR_SANITY
   while (n--)
@@ -228,13 +243,13 @@ grayscale_to_rgb (int    src_bands,
 }
 
 static void
-grayscale_alpha_premultiplied_to_rgba (int    src_bands,
-                                       void **src,
-                                       int   *src_pitch,
-                                       int    dst_bands,
-                                       void **dst,
-                                       int   *dst_pitch,
-                                       int    n)
+gray_alpha_premultiplied_to_rgba (int    src_bands,
+                                  void **src,
+                                  int   *src_pitch,
+                                  int    dst_bands,
+                                  void **dst,
+                                  int   *dst_pitch,
+                                  int    n)
 {
   BABL_PLANAR_SANITY
   assert (src_bands == 2);
@@ -264,13 +279,13 @@ grayscale_alpha_premultiplied_to_rgba (int    src_bands,
 
 
 static void
-rgba_to_grayscale_alpha_premultiplied (int    src_bands,
-                                       void **src,
-                                       int   *src_pitch,
-                                       int    dst_bands,
-                                       void **dst,
-                                       int   *dst_pitch,
-                                       int    n)
+rgba_to_gray_alpha_premultiplied (int    src_bands,
+                                  void **src,
+                                  int   *src_pitch,
+                                  int    dst_bands,
+                                  void **dst,
+                                  int   *dst_pitch,
+                                  int    n)
 {
   BABL_PLANAR_SANITY;
   assert (src_bands == 4);
@@ -361,114 +376,131 @@ static void
 conversions (void)
 {
   babl_conversion_new (
-    "babl-base: grayscale-gamma2.2 to rgba",
-    "source",      babl_model_id (BABL_GRAYSCALE_GAMMA_2_2),
+    "babl-base: gray-g2.2 to rgba",
+    "source",      babl_model_id (BABL_GRAY_GAMMA_2_2),
+    "destination", babl_model_id (BABL_RGBA),
+    "planar",      gray_2_2_to_rgb,
+    NULL
+  );
+
+
+  babl_conversion_new (
+    "babl-base: rgba to gray-g2.2",
+    "source",      babl_model_id (BABL_RGBA),
+    "destination", babl_model_id (BABL_GRAY_GAMMA_2_2),
+    "planar",      rgb_to_gray_2_2,
+    NULL
+  );
+
+  babl_conversion_new (
+    "babl-base: graya-g2.2 to rgba",
+    "source",      babl_model_id (BABL_GRAY_GAMMA_2_2_ALPHA),
     "destination", babl_model_id (BABL_RGBA),
-    "planar",      grayscale_2_2_to_rgb,
+    "planar",      gray_2_2_to_rgb,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgba to grayscale-gamma2.2",
+    "babl-base: rgba to graya-g2.2",
     "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAYSCALE_GAMMA_2_2),
-    "planar",      rgb_to_grayscale_2_2,
+    "destination", babl_model_id (BABL_GRAY_GAMMA_2_2_ALPHA),
+    "planar",      rgb_to_gray_2_2,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale to rgba",
-    "source",      babl_model_id (BABL_GRAYSCALE),
+    "babl-base: gray to rgba",
+    "source",      babl_model_id (BABL_GRAY),
     "destination", babl_model_id (BABL_RGBA),
-    "planar",      grayscale_to_rgb,
+    "planar",      gray_to_rgb,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale to rgb",
-    "source",      babl_model_id (BABL_GRAYSCALE),
+    "babl-base: gray to rgb",
+    "source",      babl_model_id (BABL_GRAY),
     "destination", babl_model_id (BABL_RGB),
-    "planar",      grayscale_to_rgb,
+    "planar",      gray_to_rgb,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale-alpha to rgba",
-    "source",      babl_model_id (BABL_GRAYSCALE_ALPHA),
+    "babl-base: gray-alpha to rgba",
+    "source",      babl_model_id (BABL_GRAY_ALPHA),
     "destination", babl_model_id (BABL_RGBA),
-    "planar",      grayscale_to_rgb,
+    "planar",      gray_to_rgb,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale-alpha to rgb",
-    "source",      babl_model_id (BABL_GRAYSCALE_ALPHA),
+    "babl-base: gray-alpha to rgb",
+    "source",      babl_model_id (BABL_GRAY_ALPHA),
     "destination", babl_model_id (BABL_RGB),
-    "planar",      grayscale_to_rgb,
+    "planar",      gray_to_rgb,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgba to grayscale-alpha",
+    "babl-base: rgba to gray-alpha",
     "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAYSCALE_ALPHA),
-    "planar",      rgb_to_grayscale,
+    "destination", babl_model_id (BABL_GRAY_ALPHA),
+    "planar",      rgb_to_gray,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgba to grayscale",
+    "babl-base: rgba to gray",
     "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAYSCALE),
-    "planar",      rgb_to_grayscale,
+    "destination", babl_model_id (BABL_GRAY),
+    "planar",      rgb_to_gray,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgb to grayscale-alpha",
+    "babl-base: rgb to gray-alpha",
     "source",      babl_model_id (BABL_RGB),
-    "destination", babl_model_id (BABL_GRAYSCALE_ALPHA),
-    "planar",      rgb_to_grayscale,
+    "destination", babl_model_id (BABL_GRAY_ALPHA),
+    "planar",      rgb_to_gray,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgb to grayscale",
+    "babl-base: rgb to gray",
     "source",      babl_model_id (BABL_RGB),
-    "destination", babl_model_id (BABL_GRAYSCALE),
-    "planar",      rgb_to_grayscale,
+    "destination", babl_model_id (BABL_GRAY),
+    "planar",      rgb_to_gray,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale-alpha to grayscale-alpha-premultiplied",
-    "source",      babl_model_id (BABL_GRAYSCALE_ALPHA),
-    "destination", babl_model_id (BABL_GRAYSCALE_ALPHA_PREMULTIPLIED),
+    "babl-base: gray-alpha to gray-alpha-premultiplied",
+    "source",      babl_model_id (BABL_GRAY_ALPHA),
+    "destination", babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
     "planar",      non_premultiplied_to_premultiplied,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale-alpha-premultuplied to grayscale-alpha",
-    "source",      babl_model_id (BABL_GRAYSCALE_ALPHA_PREMULTIPLIED),
-    "destination", babl_model_id (BABL_GRAYSCALE_ALPHA),
+    "babl-base: gray-alpha-premultuplied to gray-alpha",
+    "source",      babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
+    "destination", babl_model_id (BABL_GRAY_ALPHA),
     "planar",      premultiplied_to_non_premultiplied,
     NULL
   );
 
     babl_conversion_new (
-    "babl-base: grayscale-alpha-premultiplied to rgba",
-    "source",      babl_model_id (BABL_GRAYSCALE_ALPHA_PREMULTIPLIED),
+    "babl-base: gray-alpha-premultiplied to rgba",
+    "source",      babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
     "destination", babl_model_id (BABL_RGBA),
-    "planar",      grayscale_alpha_premultiplied_to_rgba,
+    "planar",      gray_alpha_premultiplied_to_rgba,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgba to grayscale-alpha-premultiplied",
+    "babl-base: rgba to gray-alpha-premultiplied",
     "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAYSCALE_ALPHA_PREMULTIPLIED),
-    "planar",      rgba_to_grayscale_alpha_premultiplied,
+    "destination", babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
+    "planar",      rgba_to_gray_alpha_premultiplied,
     NULL
   );
 }
index 821a75e78cc4c734bcbe06feb27246cb5aae55e1..5c1dd35c45ee42d6dd2e33472d3695d40717213a 100644 (file)
@@ -17,6 +17,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
+/* FIXME: this file should be renamed model-gray.c */
+
 #include "babl.h"
 #include "util.h"
 #include "rgb-constants.h"
@@ -26,7 +28,7 @@ static void components  (void);
 static void models      (void);
 static void conversions (void);
 
-void babl_base_model_grayscale (void)
+void babl_base_model_gray (void)
 {
   components  ();
   models      ();
@@ -37,13 +39,19 @@ static void
 components (void)
 {
   babl_component_new (
-   "luminance", 
+   "Y", 
    "id",    BABL_LUMINANCE,
    "luma",
    NULL);
 
   babl_component_new (
-   "luminance-gamma2.2", 
+   "Y*A",
+   "id",    BABL_LUMINANCE_MUL_ALPHA,
+   "luma",
+   NULL);
+
+  babl_component_new (
+   "Y-g2.2", 
    "id",    BABL_LUMINANCE_GAMMA_2_2,
    "luma",
    NULL);
@@ -53,27 +61,34 @@ static void
 models (void)
 {
   babl_model_new (
-    "grayscale",
-    "id", BABL_GRAYSCALE,
+    "gray",
+    "id", BABL_GRAY,
     babl_component_id (BABL_LUMINANCE),
     NULL);
 
   babl_model_new (
-    "grayscale-gamma2.2",
-    "id", BABL_GRAYSCALE_GAMMA_2_2,
-    babl_component_id (BABL_LUMINANCE),
+    "gray-g2.2",
+    "id", BABL_GRAY_GAMMA_2_2,
+    babl_component_id (BABL_LUMINANCE_GAMMA_2_2),
     NULL);
 
   babl_model_new (
-    "grayscale-alpha",
-    "id", BABL_GRAYSCALE_ALPHA,
+    "graya-g2.2",
+    "id", BABL_GRAY_GAMMA_2_2_ALPHA,
+    babl_component_id (BABL_LUMINANCE_GAMMA_2_2),
+    babl_component_id (BABL_ALPHA),
+    NULL);
+
+  babl_model_new (
+    "graya",
+    "id", BABL_GRAY_ALPHA,
     babl_component_id (BABL_LUMINANCE),
     babl_component_id (BABL_ALPHA),
     NULL);
 
   babl_model_new (
-    "grayscale-alpha-premultiplied",
-    "id", BABL_GRAYSCALE_ALPHA_PREMULTIPLIED,
+    "grayA",
+    "id", BABL_GRAY_ALPHA_PREMULTIPLIED,
     babl_component_id (BABL_LUMINANCE_MUL_ALPHA),
     babl_component_id (BABL_ALPHA),
     NULL);
@@ -82,13 +97,13 @@ models (void)
 
 
 static void
-rgb_to_grayscale (int    src_bands,
-                  void **src,
-                  int   *src_pitch,
-                  int    dst_bands,
-                  void **dst,
-                  int   *dst_pitch,
-                  int    n)
+rgb_to_gray (int    src_bands,
+             void **src,
+             int   *src_pitch,
+             int    dst_bands,
+             void **dst,
+             int   *dst_pitch,
+             int    n)
 {
   BABL_PLANAR_SANITY
   while (n--)
@@ -118,13 +133,13 @@ rgb_to_grayscale (int    src_bands,
 
 
 static void
-rgb_to_grayscale_2_2 (int    src_bands,
-                      void **src,
-                      int   *src_pitch,
-                      int    dst_bands,
-                      void **dst,
-                      int   *dst_pitch,
-                      int    n)
+rgb_to_gray_2_2 (int    src_bands,
+                 void **src,
+                 int   *src_pitch,
+                 int    dst_bands,
+                 void **dst,
+                 int   *dst_pitch,
+                 int    n)
 {
   BABL_PLANAR_SANITY
   while (n--)
@@ -154,13 +169,13 @@ rgb_to_grayscale_2_2 (int    src_bands,
 
 
 static void
-grayscale_2_2_to_rgb (int    src_bands,
-                      void **src,
-                      int   *src_pitch,
-                      int    dst_bands,
-                      void **dst,
-                      int   *dst_pitch,
-                      int    n)
+gray_2_2_to_rgb (int    src_bands,
+                 void **src,
+                 int   *src_pitch,
+                 int    dst_bands,
+                 void **dst,
+                 int   *dst_pitch,
+                 int    n)
 {
   BABL_PLANAR_SANITY
   while (n--)
@@ -192,13 +207,13 @@ grayscale_2_2_to_rgb (int    src_bands,
 
 
 static void
-grayscale_to_rgb (int    src_bands,
-                  void **src,
-                  int   *src_pitch,
-                  int    dst_bands,
-                  void **dst,
-                  int   *dst_pitch,
-                  int    n)
+gray_to_rgb (int    src_bands,
+             void **src,
+             int   *src_pitch,
+             int    dst_bands,
+             void **dst,
+             int   *dst_pitch,
+             int    n)
 {
   BABL_PLANAR_SANITY
   while (n--)
@@ -228,13 +243,13 @@ grayscale_to_rgb (int    src_bands,
 }
 
 static void
-grayscale_alpha_premultiplied_to_rgba (int    src_bands,
-                                       void **src,
-                                       int   *src_pitch,
-                                       int    dst_bands,
-                                       void **dst,
-                                       int   *dst_pitch,
-                                       int    n)
+gray_alpha_premultiplied_to_rgba (int    src_bands,
+                                  void **src,
+                                  int   *src_pitch,
+                                  int    dst_bands,
+                                  void **dst,
+                                  int   *dst_pitch,
+                                  int    n)
 {
   BABL_PLANAR_SANITY
   assert (src_bands == 2);
@@ -264,13 +279,13 @@ grayscale_alpha_premultiplied_to_rgba (int    src_bands,
 
 
 static void
-rgba_to_grayscale_alpha_premultiplied (int    src_bands,
-                                       void **src,
-                                       int   *src_pitch,
-                                       int    dst_bands,
-                                       void **dst,
-                                       int   *dst_pitch,
-                                       int    n)
+rgba_to_gray_alpha_premultiplied (int    src_bands,
+                                  void **src,
+                                  int   *src_pitch,
+                                  int    dst_bands,
+                                  void **dst,
+                                  int   *dst_pitch,
+                                  int    n)
 {
   BABL_PLANAR_SANITY;
   assert (src_bands == 4);
@@ -361,114 +376,131 @@ static void
 conversions (void)
 {
   babl_conversion_new (
-    "babl-base: grayscale-gamma2.2 to rgba",
-    "source",      babl_model_id (BABL_GRAYSCALE_GAMMA_2_2),
+    "babl-base: gray-g2.2 to rgba",
+    "source",      babl_model_id (BABL_GRAY_GAMMA_2_2),
+    "destination", babl_model_id (BABL_RGBA),
+    "planar",      gray_2_2_to_rgb,
+    NULL
+  );
+
+
+  babl_conversion_new (
+    "babl-base: rgba to gray-g2.2",
+    "source",      babl_model_id (BABL_RGBA),
+    "destination", babl_model_id (BABL_GRAY_GAMMA_2_2),
+    "planar",      rgb_to_gray_2_2,
+    NULL
+  );
+
+  babl_conversion_new (
+    "babl-base: graya-g2.2 to rgba",
+    "source",      babl_model_id (BABL_GRAY_GAMMA_2_2_ALPHA),
     "destination", babl_model_id (BABL_RGBA),
-    "planar",      grayscale_2_2_to_rgb,
+    "planar",      gray_2_2_to_rgb,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgba to grayscale-gamma2.2",
+    "babl-base: rgba to graya-g2.2",
     "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAYSCALE_GAMMA_2_2),
-    "planar",      rgb_to_grayscale_2_2,
+    "destination", babl_model_id (BABL_GRAY_GAMMA_2_2_ALPHA),
+    "planar",      rgb_to_gray_2_2,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale to rgba",
-    "source",      babl_model_id (BABL_GRAYSCALE),
+    "babl-base: gray to rgba",
+    "source",      babl_model_id (BABL_GRAY),
     "destination", babl_model_id (BABL_RGBA),
-    "planar",      grayscale_to_rgb,
+    "planar",      gray_to_rgb,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale to rgb",
-    "source",      babl_model_id (BABL_GRAYSCALE),
+    "babl-base: gray to rgb",
+    "source",      babl_model_id (BABL_GRAY),
     "destination", babl_model_id (BABL_RGB),
-    "planar",      grayscale_to_rgb,
+    "planar",      gray_to_rgb,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale-alpha to rgba",
-    "source",      babl_model_id (BABL_GRAYSCALE_ALPHA),
+    "babl-base: gray-alpha to rgba",
+    "source",      babl_model_id (BABL_GRAY_ALPHA),
     "destination", babl_model_id (BABL_RGBA),
-    "planar",      grayscale_to_rgb,
+    "planar",      gray_to_rgb,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale-alpha to rgb",
-    "source",      babl_model_id (BABL_GRAYSCALE_ALPHA),
+    "babl-base: gray-alpha to rgb",
+    "source",      babl_model_id (BABL_GRAY_ALPHA),
     "destination", babl_model_id (BABL_RGB),
-    "planar",      grayscale_to_rgb,
+    "planar",      gray_to_rgb,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgba to grayscale-alpha",
+    "babl-base: rgba to gray-alpha",
     "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAYSCALE_ALPHA),
-    "planar",      rgb_to_grayscale,
+    "destination", babl_model_id (BABL_GRAY_ALPHA),
+    "planar",      rgb_to_gray,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgba to grayscale",
+    "babl-base: rgba to gray",
     "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAYSCALE),
-    "planar",      rgb_to_grayscale,
+    "destination", babl_model_id (BABL_GRAY),
+    "planar",      rgb_to_gray,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgb to grayscale-alpha",
+    "babl-base: rgb to gray-alpha",
     "source",      babl_model_id (BABL_RGB),
-    "destination", babl_model_id (BABL_GRAYSCALE_ALPHA),
-    "planar",      rgb_to_grayscale,
+    "destination", babl_model_id (BABL_GRAY_ALPHA),
+    "planar",      rgb_to_gray,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgb to grayscale",
+    "babl-base: rgb to gray",
     "source",      babl_model_id (BABL_RGB),
-    "destination", babl_model_id (BABL_GRAYSCALE),
-    "planar",      rgb_to_grayscale,
+    "destination", babl_model_id (BABL_GRAY),
+    "planar",      rgb_to_gray,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale-alpha to grayscale-alpha-premultiplied",
-    "source",      babl_model_id (BABL_GRAYSCALE_ALPHA),
-    "destination", babl_model_id (BABL_GRAYSCALE_ALPHA_PREMULTIPLIED),
+    "babl-base: gray-alpha to gray-alpha-premultiplied",
+    "source",      babl_model_id (BABL_GRAY_ALPHA),
+    "destination", babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
     "planar",      non_premultiplied_to_premultiplied,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: grayscale-alpha-premultuplied to grayscale-alpha",
-    "source",      babl_model_id (BABL_GRAYSCALE_ALPHA_PREMULTIPLIED),
-    "destination", babl_model_id (BABL_GRAYSCALE_ALPHA),
+    "babl-base: gray-alpha-premultuplied to gray-alpha",
+    "source",      babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
+    "destination", babl_model_id (BABL_GRAY_ALPHA),
     "planar",      premultiplied_to_non_premultiplied,
     NULL
   );
 
     babl_conversion_new (
-    "babl-base: grayscale-alpha-premultiplied to rgba",
-    "source",      babl_model_id (BABL_GRAYSCALE_ALPHA_PREMULTIPLIED),
+    "babl-base: gray-alpha-premultiplied to rgba",
+    "source",      babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
     "destination", babl_model_id (BABL_RGBA),
-    "planar",      grayscale_alpha_premultiplied_to_rgba,
+    "planar",      gray_alpha_premultiplied_to_rgba,
     NULL
   );
 
   babl_conversion_new (
-    "babl-base: rgba to grayscale-alpha-premultiplied",
+    "babl-base: rgba to gray-alpha-premultiplied",
     "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAYSCALE_ALPHA_PREMULTIPLIED),
-    "planar",      rgba_to_grayscale_alpha_premultiplied,
+    "destination", babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
+    "planar",      rgba_to_gray_alpha_premultiplied,
     NULL
   );
 }
index f08cf9d56e6297082c882d723ef7e3cd3e9833d4..0f0729fa92c2d0dcd5507ccd050f54ef211d3ddd 100644 (file)
@@ -41,19 +41,19 @@ static void
 components (void)
 {
   babl_component_new (
-   "L",
+   "CIE L",
    "id",    BABL_LAB_L,
    "luma",
    NULL);
 
   babl_component_new (
-   "a",
+   "CIE a",
    "id",    BABL_LAB_A,
    "chroma",
    NULL);
 
   babl_component_new (
-   "b",
+   "CIE b",
    "id",    BABL_LAB_B,
    "chroma",
    NULL);
@@ -194,4 +194,13 @@ conversions (void)
 static void
 pixel_formats (void)
 {
+  babl_pixel_format_new (
+    "lab-float",
+    "id", BABL_LAB_FLOAT,
+    babl_model_id     (BABL_LAB),
+    babl_type_id      (BABL_FLOAT),
+    babl_component_id (BABL_LAB_L), 
+    babl_component_id (BABL_LAB_A), 
+    babl_component_id (BABL_LAB_B),
+    NULL);
 }
index 15b63e6a013959942324097fa45312768ca59d4c..96d41708e5d24310df821c5944ec9a760a9c5491 100644 (file)
@@ -39,42 +39,42 @@ static void
 components (void)
 {
   babl_component_new (
-    "red",
+    "R",
     "id", BABL_RED,
     "luma",
     "chroma",
     NULL);
 
   babl_component_new (
-   "green",
+   "G",
     "id",   BABL_GREEN,
    "luma", 
    "chroma",
    NULL);
   
   babl_component_new (
-   "blue",
+   "B",
     "id",   BABL_BLUE,
    "luma",
    "chroma",
    NULL);
 
   babl_component_new (
-    "red-gamma2.2",
+    "R-g2.2",
    "id",    BABL_RED_GAMMA_2_2,
     "luma",
     "chroma",
     NULL);
 
   babl_component_new (
-    "green-gamma2.2",
+    "G-g2.2",
    "id",    BABL_GREEN_GAMMA_2_2,
    "luma", 
    "chroma",
    NULL);
   
   babl_component_new (
-    "blue-gamma2.2",
+    "B-g2.2",
    "id",    BABL_BLUE_GAMMA_2_2,
    "luma",
    "chroma",
@@ -82,38 +82,33 @@ components (void)
 
 
   babl_component_new (
-   "alpha",
+   "A",
    "id",    BABL_ALPHA,
    "alpha",
    NULL);
 
   babl_component_new (
-    "red*alpha",
+    "R*A",
     "id",    BABL_RED_MUL_ALPHA,
     "luma",
     "chroma",
     "alpha",
     NULL);
   babl_component_new (
-    "green*alpha",
+    "G*A",
     "id",    BABL_GREEN_MUL_ALPHA,
     "luma",
     "chroma",
     "alpha",
     NULL);
   babl_component_new (
-    "blue*alpha",
+    "B*A",
     "id",    BABL_BLUE_MUL_ALPHA,
     "luma",
     "chroma",
     "alpha",
     NULL);
 
-  babl_component_new (
-   "luminance*alpha", 
-   "id",    BABL_LUMINANCE_MUL_ALPHA,
-   "luma",
-   NULL);
 }
 
 static void
@@ -146,7 +141,7 @@ models (void)
     NULL);
 
   babl_model_new (
-    "rgb-gamma2.2",
+    "rgb-g2.2",
     "id", BABL_RGB_GAMMA_2_2,
     babl_component_id (BABL_RED_GAMMA_2_2),
     babl_component_id (BABL_GREEN_GAMMA_2_2),
@@ -154,7 +149,7 @@ models (void)
     NULL);
 
   babl_model_new (
-    "rgba-gamma2.2",
+    "rgba-g2.2",
     "id", BABL_RGBA_GAMMA_2_2,
     babl_component_id (BABL_RED_GAMMA_2_2),
     babl_component_id (BABL_GREEN_GAMMA_2_2),
@@ -317,7 +312,7 @@ conversions (void)
   );
 
   babl_conversion_new (
-    "babl-base: rgba to rgb-gamma2.2",
+    "babl-base: rgba to rgb-g2.2",
     "source",      babl_model_id (BABL_RGBA),
     "destination", babl_model_id (BABL_RGB_GAMMA_2_2),
     "planar",      g3_gamma_2_2,
@@ -325,7 +320,7 @@ conversions (void)
   );
 
   babl_conversion_new (
-    "babl-base: rgba to rgba-gamma2.2",
+    "babl-base: rgba to rgba-g2.2",
     "source",      babl_model_id (BABL_RGBA),
     "destination", babl_model_id (BABL_RGBA_GAMMA_2_2),
     "planar",      g3_gamma_2_2,
@@ -333,7 +328,7 @@ conversions (void)
   );
 
   babl_conversion_new (
-    "babl-base: rgb-gamma2.2 to rgba",
+    "babl-base: rgb-g2.2 to rgba",
     "source",      babl_model_id (BABL_RGB_GAMMA_2_2),
     "destination", babl_model_id (BABL_RGBA),
     "planar",      g3_inv_gamma_2_2,
@@ -341,7 +336,7 @@ conversions (void)
   );
 
   babl_conversion_new (
-    "babl-base: rgba-gamma2.2 to rgba",
+    "babl-base: rgba-g2.2 to rgba",
     "source",      babl_model_id (BABL_RGBA_GAMMA_2_2),
     "destination", babl_model_id (BABL_RGBA),
     "planar",      g3_inv_gamma_2_2,
index 3c2feba85cde059e52163676e13df155c2bcce4a..d3c7b242f2333cb5c44c906afb7ee3cf2ea7682d 100644 (file)
@@ -42,13 +42,13 @@ static void
 components (void)
 {
   babl_component_new (
-   "cb",
+   "Cb",
    "id", BABL_CB,
    "chroma",
    NULL);
 
   babl_component_new (
-   "cr",
+   "Cr",
    "id", BABL_CR,
    "chroma",
    NULL);
@@ -67,7 +67,7 @@ models (void)
 
   babl_model_new (
     "ycbcra",
-    "id", BABL_YCBCRA,
+    "id", BABL_YCBCR_ALPHA,
     babl_component_id (BABL_LUMINANCE_GAMMA_2_2),
     babl_component_id (BABL_CB),
     babl_component_id (BABL_CR),
@@ -185,13 +185,13 @@ conversions (void)
   babl_conversion_new (
     "babl-base: rgba to ycbcra",
     "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_YCBCRA),
+    "destination", babl_model_id (BABL_YCBCR_ALPHA),
     "planar",      rgb_to_ycbcr,
     NULL
   );
   babl_conversion_new (
     "babl-base: ycbcra to rgba",
-    "source",      babl_model_id (BABL_YCBCRA),
+    "source",      babl_model_id (BABL_YCBCR_ALPHA),
     "destination", babl_model_id (BABL_RGBA),
     "planar",      ycbcr_to_rgb,
     NULL
index 86b9e4ddb0bb7e66aaf8d569ef9aaaab020a73a6..e1b4bd524d06f679047287152d876522649e06f7 100644 (file)
@@ -54,16 +54,16 @@ test_float_to_rgb_u8 (void)
   fish = babl_fish (
     babl_pixel_format_new (
       "foo",
-      babl_model ("grayscale"),
+      babl_model ("gray"),
       babl_type ("float"),
-      babl_component ("luminance"),
+      babl_component ("Y"),
       NULL
     ),
     babl_pixel_format_new (
       "bar",
-      babl_model ("grayscale"),
+      babl_model ("gray"),
       babl_type ("u8"),
-      babl_component ("luminance"),
+      babl_component ("Y"),
       NULL
     ));
 
index 367689d8376eefb5a56f5ee10111bd5038ab9457..6d5170126058ca7daea80085a5b6a8a2d22d39ac 100644 (file)
@@ -40,18 +40,18 @@ test (void)
   fish = babl_fish (
     babl_pixel_format_new (
       "foo",
-      babl_model ("grayscale"),
+      babl_model ("gray"),
       babl_type ("float"),
-      babl_component ("luminance"),
+      babl_component ("Y"),
       NULL
     ),
     babl_pixel_format_new (
       "bar",
       babl_model ("rgb"),
       babl_type ("float"),
-      babl_component ("red"),
-      babl_component ("green"),
-      babl_component ("blue"),
+      babl_component ("R"),
+      babl_component ("G"),
+      babl_component ("B"),
       NULL
     )
   );
index eec4f2722a1f4e31f8378372f1b746e8d4e47ca5..9c5f4776641f39fd34eac68bbc7c91caa1a607a0 100644 (file)
@@ -79,18 +79,18 @@ test (void)
       "foo",
       babl_model ("rgb"),
       babl_type ("float"),
-      babl_component ("red"),
-      babl_component ("green"),
-      babl_component ("blue"),
+      babl_component ("R"),
+      babl_component ("G"),
+      babl_component ("B"),
       NULL
     ),
     babl_pixel_format_new (
       "bar",
       babl_model ("CIE Lab"),
       babl_type ("float"), 
-      babl_component ("L"),
-      babl_component ("a"),
-      babl_component ("b"),
+      babl_component ("CIE L"),
+      babl_component ("CIE a"),
+      babl_component ("CIE b"),
       NULL
     )
   );
index 1208698d09a37020dc0220b377837f34113506db..11d03e77d307ff3266761df3ebb9bae2e4200c32 100644 (file)
@@ -56,18 +56,18 @@ test (void)
       "foo",
       babl_model ("rgb"),
       babl_type ("float"),
-      babl_component ("red"),
-      babl_component ("green"),
-      babl_component ("blue"),
+      babl_component ("R"),
+      babl_component ("G"),
+      babl_component ("B"),
       NULL
     ),
     babl_pixel_format_new (
       "bar",
       babl_model ("ycbcr"),
       babl_type ("float"),
-      babl_component ("luminance"),
-      babl_component ("cb"),
-      babl_component ("cr"),
+      babl_component ("Y"),
+      babl_component ("Cb"),
+      babl_component ("Cr"),
       NULL
     )
   );
index 4b324d2080ac0fee258583b0a2c0902671733ee9..57ee6e807342d49eb860c32d8120b52eb028353f 100644 (file)
@@ -48,18 +48,18 @@ test (void)
       "foo",
       babl_model ("rgb"),
       babl_type ("float"),
-      babl_component ("red"),
-      babl_component ("green"),
-      babl_component ("blue"),
+      babl_component ("R"),
+      babl_component ("G"),
+      babl_component ("B"),
       NULL
     ),
     babl_pixel_format_new (
       "bar",
       babl_model ("ycbcr"),
       babl_type ("float"), 
-      babl_component ("luminance"),
-      babl_component ("cb"),
-      babl_component ("cr"),
+      babl_component ("Y"),
+      babl_component ("Cb"),
+      babl_component ("Cr"),
       NULL
     )
   );
index e22102121666fab16e73cea82a38a0b21c10239f..7ffa2cba6efed1a7fef1da3e9e2ec4e169dc6b18 100644 (file)
@@ -39,16 +39,16 @@ test (void)
   fish = babl_fish (
     babl_pixel_format_new (
       "foo",
-      babl_model ("grayscale"),
+      babl_model ("gray"),
       babl_type ("u8"),
-      babl_component ("luminance"),
+      babl_component ("Y"),
       NULL
     ),
     babl_pixel_format_new (
       "bar",
-      babl_model ("grayscale"),
+      babl_model ("gray"),
       babl_type ("float"),
-      babl_component ("luminance"),
+      babl_component ("Y"),
       NULL
     ));